﻿@model IEnumerable<Provider.Models.Consumer>

@{
    ViewBag.Title = "LTI Tool Consumers";
}

<h2>@ViewBag.Title.</h2>
<h3>A list of all the LTI Tool Consumers registered in this provider.</h3>

<p>
    Remember, you are one of several users of this sample provider. 
    Please do not muck with other people's LTI consumers.
</p>

@if (!Model.Any()) {
    <text>
        No consumers have been registered yet.
    </text>
} else {
    <text>
        <table class="table">
            <tr>
                <th>
                    @Html.DisplayNameFor(model => model.Name)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Key)
                </th>
                <th></th>
            </tr>

        @foreach (var item in Model) {
            <tr>
                <td>
                    @Html.ActionLink(item.Name, "Details", new { id=item.ConsumerId })
                </td>
                <td>
                    @item.Key
                </td>
                <td>
                    @Html.ActionLink("Edit", "Edit", new { id=item.ConsumerId }) |
                    @Html.ActionLink("Delete", "Delete", new { id=item.ConsumerId })
                </td>
            </tr>
        }

        </table>
    </text>
}        

<p>
    @Html.ActionLink("Create New", "Create") |
    @Html.ActionLink("Back to Home", "Index", "Home")
</p>

